Integrand size = 39, antiderivative size = 132 \[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {C (b \tan (c+d x))^{3+n}}{b^3 d (3+n)}+\frac {(A-C) \operatorname {Hypergeometric2F1}\left (1,\frac {3+n}{2},\frac {5+n}{2},-\tan ^2(c+d x)\right ) (b \tan (c+d x))^{3+n}}{b^3 d (3+n)}+\frac {B \operatorname {Hypergeometric2F1}\left (1,\frac {4+n}{2},\frac {6+n}{2},-\tan ^2(c+d x)\right ) (b \tan (c+d x))^{4+n}}{b^4 d (4+n)} \]
C*(b*tan(d*x+c))^(3+n)/b^3/d/(3+n)+(A-C)*hypergeom([1, 3/2+1/2*n],[5/2+1/2 *n],-tan(d*x+c)^2)*(b*tan(d*x+c))^(3+n)/b^3/d/(3+n)+B*hypergeom([1, 2+1/2* n],[3+1/2*n],-tan(d*x+c)^2)*(b*tan(d*x+c))^(4+n)/b^4/d/(4+n)
Time = 0.63 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.83 \[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {\tan ^3(c+d x) (b \tan (c+d x))^n \left (C (4+n)+(A-C) (4+n) \operatorname {Hypergeometric2F1}\left (1,\frac {3+n}{2},\frac {5+n}{2},-\tan ^2(c+d x)\right )+B (3+n) \operatorname {Hypergeometric2F1}\left (1,\frac {4+n}{2},\frac {6+n}{2},-\tan ^2(c+d x)\right ) \tan (c+d x)\right )}{d (3+n) (4+n)} \]
(Tan[c + d*x]^3*(b*Tan[c + d*x])^n*(C*(4 + n) + (A - C)*(4 + n)*Hypergeome tric2F1[1, (3 + n)/2, (5 + n)/2, -Tan[c + d*x]^2] + B*(3 + n)*Hypergeometr ic2F1[1, (4 + n)/2, (6 + n)/2, -Tan[c + d*x]^2]*Tan[c + d*x]))/(d*(3 + n)* (4 + n))
Time = 0.54 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.03, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.205, Rules used = {2030, 3042, 4113, 3042, 4021, 3042, 3957, 278}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 2030 |
\(\displaystyle \frac {\int (b \tan (c+d x))^{n+2} \left (C \tan ^2(c+d x)+B \tan (c+d x)+A\right )dx}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (b \tan (c+d x))^{n+2} \left (C \tan (c+d x)^2+B \tan (c+d x)+A\right )dx}{b^2}\) |
\(\Big \downarrow \) 4113 |
\(\displaystyle \frac {\int (b \tan (c+d x))^{n+2} (A-C+B \tan (c+d x))dx+\frac {C (b \tan (c+d x))^{n+3}}{b d (n+3)}}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (b \tan (c+d x))^{n+2} (A-C+B \tan (c+d x))dx+\frac {C (b \tan (c+d x))^{n+3}}{b d (n+3)}}{b^2}\) |
\(\Big \downarrow \) 4021 |
\(\displaystyle \frac {(A-C) \int (b \tan (c+d x))^{n+2}dx+\frac {B \int (b \tan (c+d x))^{n+3}dx}{b}+\frac {C (b \tan (c+d x))^{n+3}}{b d (n+3)}}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(A-C) \int (b \tan (c+d x))^{n+2}dx+\frac {B \int (b \tan (c+d x))^{n+3}dx}{b}+\frac {C (b \tan (c+d x))^{n+3}}{b d (n+3)}}{b^2}\) |
\(\Big \downarrow \) 3957 |
\(\displaystyle \frac {\frac {b (A-C) \int \frac {(b \tan (c+d x))^{n+2}}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{d}+\frac {B \int \frac {(b \tan (c+d x))^{n+3}}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{d}+\frac {C (b \tan (c+d x))^{n+3}}{b d (n+3)}}{b^2}\) |
\(\Big \downarrow \) 278 |
\(\displaystyle \frac {\frac {(A-C) (b \tan (c+d x))^{n+3} \operatorname {Hypergeometric2F1}\left (1,\frac {n+3}{2},\frac {n+5}{2},-\tan ^2(c+d x)\right )}{b d (n+3)}+\frac {B (b \tan (c+d x))^{n+4} \operatorname {Hypergeometric2F1}\left (1,\frac {n+4}{2},\frac {n+6}{2},-\tan ^2(c+d x)\right )}{b^2 d (n+4)}+\frac {C (b \tan (c+d x))^{n+3}}{b d (n+3)}}{b^2}\) |
((C*(b*Tan[c + d*x])^(3 + n))/(b*d*(3 + n)) + ((A - C)*Hypergeometric2F1[1 , (3 + n)/2, (5 + n)/2, -Tan[c + d*x]^2]*(b*Tan[c + d*x])^(3 + n))/(b*d*(3 + n)) + (B*Hypergeometric2F1[1, (4 + n)/2, (6 + n)/2, -Tan[c + d*x]^2]*(b *Tan[c + d*x])^(4 + n))/(b^2*d*(4 + n)))/b^2
3.1.45.3.1 Defintions of rubi rules used
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[a^p*(( c*x)^(m + 1)/(c*(m + 1)))*Hypergeometric2F1[-p, (m + 1)/2, (m + 1)/2 + 1, ( -b)*(x^2/a)], x] /; FreeQ[{a, b, c, m, p}, x] && !IGtQ[p, 0] && (ILtQ[p, 0 ] || GtQ[a, 0])
Int[(Fx_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Simp[1/b^m Int[(b*v) ^(m + n)*Fx, x], x] /; FreeQ[{b, n}, x] && IntegerQ[m]
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b/d Subst[Int [x^n/(b^2 + x^2), x], x, b*Tan[c + d*x]], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Tan[e + f*x])^m, x], x] + Simp[d/b Int [(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ[c^ 2 + d^2, 0] && !IntegerQ[2*m]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Si mp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && !LeQ[m, -1]
\[\int \tan \left (d x +c \right )^{2} \left (b \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )+C \tan \left (d x +c \right )^{2}\right )d x\]
\[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\int { {\left (C \tan \left (d x + c\right )^{2} + B \tan \left (d x + c\right ) + A\right )} \left (b \tan \left (d x + c\right )\right )^{n} \tan \left (d x + c\right )^{2} \,d x } \]
integrate(tan(d*x+c)^2*(b*tan(d*x+c))^n*(A+B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="fricas")
\[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\int \left (b \tan {\left (c + d x \right )}\right )^{n} \left (A + B \tan {\left (c + d x \right )} + C \tan ^{2}{\left (c + d x \right )}\right ) \tan ^{2}{\left (c + d x \right )}\, dx \]
\[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\int { {\left (C \tan \left (d x + c\right )^{2} + B \tan \left (d x + c\right ) + A\right )} \left (b \tan \left (d x + c\right )\right )^{n} \tan \left (d x + c\right )^{2} \,d x } \]
integrate(tan(d*x+c)^2*(b*tan(d*x+c))^n*(A+B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="maxima")
\[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\int { {\left (C \tan \left (d x + c\right )^{2} + B \tan \left (d x + c\right ) + A\right )} \left (b \tan \left (d x + c\right )\right )^{n} \tan \left (d x + c\right )^{2} \,d x } \]
Timed out. \[ \int \tan ^2(c+d x) (b \tan (c+d x))^n \left (A+B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\int {\mathrm {tan}\left (c+d\,x\right )}^2\,{\left (b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n\,\left (C\,{\mathrm {tan}\left (c+d\,x\right )}^2+B\,\mathrm {tan}\left (c+d\,x\right )+A\right ) \,d x \]